package cn.com.cym.gamezao.entity.grk;

import cn.com.cym.gamezao.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;

@Getter
@Setter
@NoArgsConstructor
@Entity
@Accessors(chain = true)
@Table(name ="sample_examination")
@ApiModel(description = "检验信息")
public class Examination extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -6814996023205610740L;


    @ManyToOne
    @JoinColumn(name = "patient_id")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Patient patient;


    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(name = "time",value = "检验日期",dataType = "LocalDate")
    private LocalDate time;


    /**
     * 明细
     */
    @Column(length = 600)
    private String detail;

    /**
     * 备注
     */
    @Column(length = 200)
    private String memo;
}
